<!doctype html>
<html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<img src="http://localhost:8080/security/resources/cors-image.php?max-age=60" crossorigin></img>
<script>
async_test((test) => {
  document.querySelector('img').addEventListener('load', () => {
    const iframe = document.createElement('iframe');
    iframe.sandbox = 'allow-scripts';
    iframe.src = 'resources/cors-check-for-cached-image-iframe.html';
    document.body.appendChild(iframe);
  });
  window.addEventListener('message', test.step_func_done((e) => {
    assert_equals(e.data, 'PASS');
  }));
}, 'We should not reuse CORS check result when requested from another origin');
</script>
